<template>
  <div class="menu_wrap">
    <el-menu
      class="el-menu-vertical-demo"
      @open="handleOpen"
      @close="handleClose"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
      @select="handleSel"
    >
      <el-menu-item index="/layout">
        <i class="el-icon-location"></i>首页
      </el-menu-item>
      <!-- 菜单2 -->
      <el-submenu index="layout" v-if="$store.state.user.power">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>人员管理</span>
        </template>
        <el-menu-item index="/layout/admin">管理员</el-menu-item>
        <el-menu-item index="/layout/student">学员管理</el-menu-item>
      </el-submenu>
      <!-- 菜单2 -->
      <el-submenu index="2">
        <template slot="title">
          <i class="el-icon-location"></i>
          <span>课程管理</span>
        </template>
        <el-menu-item index="/layout/courseadd">课程添加</el-menu-item>
        <el-menu-item index="/layout/courselist">课程列表</el-menu-item>
        <el-menu-item index="/layout/videolist">视频管理</el-menu-item>
        <el-menu-item index="/layout/test">测试表格</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>
<script>
export default {
  methods: {
    handleOpen () {},
    handleClose () {},
    handleSel (val) {
      this.$router.push(val)
    }
  }
}
</script>
<style lang="less">
.menu_wrap {
  width: 300px;
  height: calc(100vh - 70px);
  background: sandybrown;
}
</style>
